//package com.punch.order.controller;
//
//import com.punch.common.dto.course.ClassStartDTO;
//import com.punch.common.dto.order.OrderCancelDTO;
//import com.punch.common.dto.order.OrderDTO;
//import com.punch.common.dto.order.SimpleOrderDTO;
//import com.punch.common.model.Result;
//import com.punch.common.page.PageInfo;
//import com.punch.common.query.order.OrderQueryInfo;
//import com.punch.common.vo.order.*;
//import com.punch.order.service.OrderService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.web.bind.annotation.*;
//
//import javax.annotation.Resource;
//import javax.servlet.http.HttpServletRequest;
//import javax.validation.Valid;
//import java.util.List;
//import java.util.Map;
//
///**
// * OrderController-订单管理
// *
// * @author wujj
// * @version 1.0.0
// * @since 2020/7/14 10:51
// */
//@RestController
//@Api(value = "OrderController", tags = "订单管理Controller")
//public class OrderController {
//
//    @Resource
//    private OrderService orderService;
//
////
////    /**
////     * 下单前进行验证
////     *
////     * @param courseClassId 课程id
////     * @param studentId     学生id
////     * @param studentName   学生姓名
////     * @param coursePrice   课程价格
////     * @return 是否有资格报名
////     */
////    @GetMapping(value = "/order/validate/{courseClassId}/{studentId}", produces = "application/json; charset=utf-8")
////    @ApiOperation(value = "下单前进行验证", notes = "下单前进行验证", produces = "application/json")
////    public Result validateOrder(@PathVariable Long courseClassId, @PathVariable Long studentId,
////                                @RequestParam("studentName") String studentName,
////                                @RequestParam("coursePrice") BigDecimal coursePrice) {
////        return Result.succeed(orderService.validateOrder(courseClassId, studentId, studentName, coursePrice));
////    }
//
//    /**
//     * 创建订单
//     *
//     * @param orderDTO 订单信息
//     * @return orderId
//     * @author xiaol
//     * @since 2020/8/3
//     */
////    @PostMapping(value = "/order", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "创建订单", notes = "创建订单", produces = "application/json")
//    public Result createOrder(@Valid @RequestBody OrderDTO orderDTO, HttpServletRequest request) {
//        return Result.succeed(orderService.createOrder(orderDTO, request));
//    }
//
//    /**
//     * 查询家长下的订单信息列表
//     *
//     * @param orderQueryInfo 查询条件
//     * @return PageInfo<OrderAppPageVO>
//     * @author xiaol
//     * @since 2020/7/23
//     */
//    @GetMapping(value = "/orders/app", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "查询家长下的订单信息列表", notes = "查询家长下的订单信息列表", produces = "application/json")
//    public Result<PageInfo<OrderAppPageVO>> listAppOrder(@ModelAttribute OrderQueryInfo orderQueryInfo) {
//        return Result.succeed(orderService.listAppOrder(orderQueryInfo));
//    }
//
//    /**
//     * 根据订单id查询到订单详情
//     *
//     * @param orderId 主订单id
//     * @return OrderAppDetailVO
//     * @author xiaol
//     * @since 2020/7/23
//     */
//    @GetMapping(value = "/order/app/{orderId}", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "根据订单id查询到订单详情", notes = "根据订单id查询到订单详情", produces = "application/json")
//    public Result<OrderAppDetailVO> getAppOrder(@PathVariable Long orderId) {
//        return Result.succeed(orderService.getAppOrder(orderId));
//    }
//
//
//    /**
//     * 订单列表
//     *
//     * @param orderQueryInfo 查询条件
//     * @return PageInfo<OrderAppPageVO>
//     * @author xiaol
//     * @since 2020/7/23
//     */
//    @GetMapping(value = "/orders", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "订单列表", notes = "订单列表", produces = "application/json")
//    public Result<PageInfo<OrderPageVO>> listOrder(@ModelAttribute OrderQueryInfo orderQueryInfo) {
//        return Result.succeed(orderService.listOrder(orderQueryInfo));
//    }
//
//    /**
//     * 订单详情
//     *
//     * @param orderId 订单id
//     * @return OrderDetailVO
//     * @author wujj
//     * @since 2020/9/17 16:16
//     */
//    @GetMapping(value = "/order/{orderId}", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "订单详情", notes = "订单详情", produces = "application/json")
//    public Result<OrderDetailVO> getOrder(@PathVariable Long orderId) {
//        return Result.succeed(orderService.getOrder(orderId));
//    }
//
//
//    /**
//     * 获取用户订单状态统计
//     *
//     * @return map
//     */
//    @GetMapping(value = "/order/status/count")
//    public Result<Map<String, Integer>> getOrderStatusCount() {
//        return Result.succeed(orderService.getOrderStatusCount());
//    }
//
//
//    /**
//     * 开班修改订单状态
//     *
//     * @param classStartDTO 开课信息
//     * @return 是否成功
//     */
//    @PutMapping(value = "/order/start-class", produces = "application/json; charset=utf-8")
//    public Boolean startClass(@RequestBody ClassStartDTO classStartDTO) {
//        return orderService.startClass(classStartDTO);
//    }
//
//
//    /**
//     * 待支付订单进行支付
//     *
//     * @param orderId 订单id
//     * @return 支付回调信息
//     */
//    @PostMapping(value = "/order/pay/{orderId}", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "待支付订单进行支付", notes = "待支付订单进行支付", produces = "application/json")
//    public Result payOrder(@PathVariable Long orderId, HttpServletRequest request) {
//        return Result.succeed(orderService.payOrder(orderId, request));
//    }
//
//    /**
//     * 获取开班课程的报名学生id列表
//     *
//     * @param courseClassId 班级id
//     * @return 学生id列表
//     */
//    @GetMapping(value = "/order/course-class-student/{classId}", produces = "application/json; charset=utf-8")
//    public List<StudentCourseClassVO> getCourseClassOrderStudent(@PathVariable("classId") Long courseClassId) {
//        return orderService.getCourseClassOrderStudent(courseClassId);
//    }
//
//
//    /**
//     * 订单取消,未支付订单取消
//     *
//     * @param orderId 订单id
//     * @return ""
//     */
//    @DeleteMapping(value = "/order/cancel/un-pay/{orderId}", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "订单取消,未支付订单取消", notes = "订单取消,未支付订单取消", produces = "application/json")
//    public Result cancelUnPayOrder(@PathVariable Long orderId) {
//        return Result.succeed(orderService.cancelUnPayOrder(orderId));
//    }
//
//    /**
//     * 订单取消,已支付订单取消
//     *
//     * @param orderCancelDTO 取消订单信息
//     * @return ""
//     */
//    @DeleteMapping(value = "/order/cancel/pay", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "订单取消,已支付订单取消", notes = "订单取消,已支付订单取消", produces = "application/json")
//    public Result cancelPayOrder(@RequestBody OrderCancelDTO orderCancelDTO) {
//        return Result.succeed(orderService.cancelPayOrder(orderCancelDTO));
//    }
//
//
//    /**
//     * 后台管理系统创建订单
//     *
//     * @param simpleOrderDTO 订单信息
//     * @return orderId
//     * @author xiaol
//     * @since 2020/8/3
//     */
//    @PostMapping(value = "/order/back", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "后台管理系统创建订单", notes = "后台管理系统创建订单", produces = "application/json")
//    public Result createOrderByBack(@Valid @RequestBody SimpleOrderDTO simpleOrderDTO) {
//        return Result.succeed(orderService.createOrderByBack(simpleOrderDTO));
//    }
//}
